import request from '@/utils/request.js'

export const getUserInfo = () => {
  return request.get('user/getUserInfo')
}

export const getFriendList = () => {
  return request.get('user/getFriendList')
}

export const getFriendInfo = (friendId) => {
  return request.get('user/getFriendInfo', {
    params: {
      friendId
    }
  })
}

export const searchUser = (keyword) => {
  return request.get('user/searchUser', {
    params: {
      keyword
    }
  })
}

export const addFriend = (addUserId) => {
  return request.get('user/addFriend', {
    params: {
      addUserId
    }
  })
}

export const updateUser = (username, chatId, signature) => {
  return request.post('user/updateUser', {
    username,
    chatId,
    signature
  })
}
